#include <cstdio>
int ASCII[128] = {0};//散列
char str[10001] = {0};
int main()
{
    char c;
    int len;
    while ((c = getchar()) != '\n')
    {
        str[len++] = c;
    }
    while((c=getchar())!='\n')
    {
        ++ASCII[c];
    }
    int i;
    for(i=0;i<len;++i)
    {
        if(0==ASCII[str[i]])
        {
            putchar(str[i]);
        }
    }
    putchar('\n');
    return 0;
}